using UnityEngine;
using System.Collections;

public class ItemsCollectionMgr : MonoBehaviour {
	public static ItemsCollectionMgr Instance;
	private ArrayList items;
	TempScoreBoard scoreBoard;
	private int _currItem;
	
	
	void Awake(){
		Instance = this;
		items = new ArrayList();
	}
	// Use this for initialization
	void Start () {
		
		
		scoreBoard = GetComponent<TempScoreBoard>();
	}
	
	public void RegisterItem(Item it){
		items.Add(it);
		it.itemIndex = items.Count - 1;
	}
	
	public void CollectItem(int itemIndex)
	{
		_currItem = itemIndex;
		(items[_currItem] as Item).CollectThisItem();
		scoreBoard.score++;
	}
}
